#include "head.h"

int cmd_separate(const char* cmd,char* tokens[],int* tokenNum){
    char buf[1024] = {0};
    strncpy(buf,cmd,sizeof(buf));
    char* token;
    char* ptr;
    
    token = strtok_r(buf," ",&ptr);
    *tokenNum = 0;
    while(token != NULL){
        tokens[(*tokenNum)++] = token;
        token = strtok_r(NULL," ",&ptr);
    }
    return 0;
}
